VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MsComCtl.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmMaintTrucker 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   8130
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   10710
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   8130
   ScaleWidth      =   10710
   ShowInTaskbar   =   0   'False
   Begin ITGControls.ITGTab SSTab1 
      Height          =   6750
      Left            =   0
      TabIndex        =   0
      Top             =   1035
      Width           =   10470
      _ExtentX        =   18468
      _ExtentY        =   11906
      TabCount        =   2
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   2
      Tab(0)ContCtrlCap(1)=   "SSTab2"
      Tab(0)ContCtrlCap(2)=   "ComunionFrames1"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483630
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   6435
         Left            =   -75000
         TabIndex        =   22
         TabStop         =   0   'False
         Top             =   315
         Width           =   10470
         _ExtentX        =   18468
         _ExtentY        =   11351
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   3
         BeginProperty Column00 
            DataField       =   "cTruckerCode"
            Caption         =   "Trucker ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cName"
            Caption         =   "Trucker Name"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cAddress"
            Caption         =   "Address"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1695.118
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   4064.882
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   4020.095
            EndProperty
         EndProperty
      End
      Begin ITGControls.ITGTab SSTab2 
         Height          =   2325
         Left            =   0
         TabIndex        =   29
         Top             =   4425
         Width           =   10455
         _ExtentX        =   18441
         _ExtentY        =   4101
         TabCount        =   1
         TabCaption(0)   =   "               Route Rate               "
         TabContCtrlCnt(0)=   1
         Tab(0)ContCtrlCap(1)=   "dtgRouteRate"
         TabTheme        =   2
         ActiveTabBackEndColor=   16243138
         InActiveTabBackStartColor=   16243138
         InActiveTabBackEndColor=   16243138
         InActiveTabForeColor=   -2147483631
         BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         OuterBorderColor=   4210752
         TopLeftInnerBorderColor=   8421504
         BottomRightInnerBorderColor=   4210752
         DisabledTabBackColor=   16243138
         DisabledTabForeColor=   -2147483630
         Begin MSDataGridLib.DataGrid dtgRouteRate 
            Height          =   2010
            Left            =   0
            TabIndex        =   21
            Top             =   315
            Width           =   10470
            _ExtentX        =   18468
            _ExtentY        =   3545
            _Version        =   393216
            AllowArrows     =   -1  'True
            HeadLines       =   1
            RowHeight       =   15
            TabAcrossSplits =   -1  'True
            TabAction       =   2
            FormatLocked    =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   7
            BeginProperty Column00 
               DataField       =   "cRouteCode"
               Caption         =   "Route Code"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "cOrigin"
               Caption         =   "Origin"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "nKM"
               Caption         =   "KM"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "cDestination"
               Caption         =   "Destination"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "nRates"
               Caption         =   "Rate"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.0000"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "dDate"
               Caption         =   "Date"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "M/d/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            BeginProperty Column06 
               DataField       =   "dLastUpdated"
               Caption         =   "Last Update Date"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "M/d/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Button          =   -1  'True
                  ColumnWidth     =   1305.071
               EndProperty
               BeginProperty Column01 
                  Locked          =   -1  'True
                  ColumnWidth     =   2250.142
               EndProperty
               BeginProperty Column02 
                  Alignment       =   1
                  Locked          =   -1  'True
                  ColumnWidth     =   750.047
               EndProperty
               BeginProperty Column03 
                  Locked          =   -1  'True
                  ColumnWidth     =   2250.142
               EndProperty
               BeginProperty Column04 
                  Alignment       =   1
                  ColumnWidth     =   900.284
               EndProperty
               BeginProperty Column05 
                  Locked          =   -1  'True
                  ColumnWidth     =   1200.189
               EndProperty
               BeginProperty Column06 
                  Locked          =   -1  'True
                  ColumnWidth     =   1379.906
               EndProperty
            EndProperty
         End
      End
      Begin ITGControls.ComunionFrames ComunionFrames1 
         Height          =   4125
         Left            =   0
         Top             =   315
         Width           =   10470
         _ExtentX        =   18468
         _ExtentY        =   7276
         FrameColor      =   4210752
         BackColor       =   16243138
         FillColor       =   16243138
         RoundedCorner   =   0   'False
         Caption         =   "Information"
         Alignment       =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ThemeColor      =   5
         ColorFrom       =   16243138
         ColorTo         =   16250865
         Begin VB.Timer Timer1 
            Interval        =   300
            Left            =   3000
            Top             =   510
         End
         Begin VB.ComboBox cboCountry 
            Height          =   315
            Left            =   1485
            Style           =   2  'Dropdown List
            TabIndex        =   18
            Top             =   3090
            Width           =   4110
         End
         Begin VB.ComboBox cboType 
            Height          =   315
            ItemData        =   "frmMaintTrucker.frx":0000
            Left            =   8250
            List            =   "frmMaintTrucker.frx":000D
            Style           =   2  'Dropdown List
            TabIndex        =   2
            Top             =   540
            Width           =   1470
         End
         Begin ITGControls.ITGCheckBox chkInsured 
            Height          =   300
            Left            =   5700
            TabIndex        =   11
            Top             =   2145
            Width           =   855
            _ExtentX        =   1508
            _ExtentY        =   529
            BackColor       =   16243138
            Caption         =   "Insured"
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin ITGControls.ITGTextBox txtTruckerCode 
            Height          =   285
            Left            =   180
            TabIndex        =   1
            Top             =   570
            Width           =   2745
            _ExtentX        =   4630
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Trucker ID"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   1405
            TextTrim        =   -1  'True
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtName 
            Height          =   285
            Left            =   180
            TabIndex        =   3
            Top             =   885
            Width           =   6375
            _ExtentX        =   11033
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Trucker Name"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   5035
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtCountry 
            Height          =   285
            Left            =   4155
            TabIndex        =   26
            Tag             =   "cboCountry"
            Top             =   3090
            Visible         =   0   'False
            Width           =   1335
            _ExtentX        =   2249
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Country"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   1275
         End
         Begin ITGControls.ITGTextBox txtAddress 
            Height          =   285
            Left            =   180
            TabIndex        =   13
            Top             =   2460
            Width           =   6375
            _ExtentX        =   11033
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Address"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   5035
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtFax 
            Height          =   285
            Left            =   6795
            TabIndex        =   14
            Top             =   2460
            Width           =   3225
            _ExtentX        =   5477
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Fax"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   2265
         End
         Begin ITGControls.ITGTextBox txtInternet 
            Height          =   285
            Left            =   6795
            TabIndex        =   17
            Top             =   2775
            Width           =   3225
            _ExtentX        =   5477
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Internet"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   2265
         End
         Begin ITGControls.ITGTextBox txtEMail 
            Height          =   285
            Left            =   6795
            TabIndex        =   20
            Top             =   3090
            Width           =   3225
            _ExtentX        =   5477
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "E-mail"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   2265
         End
         Begin ITGControls.ITGTextBox txtCity 
            Height          =   285
            Left            =   180
            TabIndex        =   15
            Top             =   2775
            Width           =   3735
            _ExtentX        =   6376
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "City / State"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   2395
         End
         Begin ITGControls.ITGTextBox txtState 
            Height          =   285
            Left            =   3915
            TabIndex        =   16
            Top             =   2775
            Width           =   2640
            _ExtentX        =   4551
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Street"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   2580
         End
         Begin ITGControls.ITGTextBox txtZip 
            Height          =   285
            Left            =   5580
            TabIndex        =   19
            Top             =   3090
            Width           =   975
            _ExtentX        =   1614
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Street"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   915
         End
         Begin ITGControls.ITGTextBox txtPhone 
            Height          =   285
            Left            =   6795
            TabIndex        =   12
            Top             =   2145
            Width           =   3225
            _ExtentX        =   5477
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Phone"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   2265
         End
         Begin ITGControls.ITGTextBox txtPayee 
            Height          =   285
            Left            =   180
            TabIndex        =   4
            Top             =   1200
            Width           =   6375
            _ExtentX        =   11033
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "RFP Payee"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   5035
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtContact 
            Height          =   285
            Left            =   180
            TabIndex        =   6
            Top             =   1515
            Width           =   6375
            _ExtentX        =   11033
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Contact"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   5035
         End
         Begin ITGControls.ITGTextBox txtOwner 
            Height          =   285
            Left            =   180
            TabIndex        =   8
            Top             =   1830
            Width           =   6375
            _ExtentX        =   11033
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Owner"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   5035
         End
         Begin ITGControls.ITGTextBox txtTrailer 
            Height          =   285
            Left            =   6795
            TabIndex        =   7
            Top             =   1515
            Width           =   2145
            _ExtentX        =   3572
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            Label           =   "Trailer"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   1185
         End
         Begin ITGControls.ITGTextBox txtVan 
            Height          =   285
            Left            =   6795
            TabIndex        =   9
            Top             =   1830
            Width           =   2145
            _ExtentX        =   3572
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            Label           =   "Van"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   1185
         End
         Begin ITGControls.ITGTextBox txtTIN 
            Height          =   285
            Left            =   180
            TabIndex        =   10
            Top             =   2145
            Width           =   3735
            _ExtentX        =   6376
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "TIN"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1280
            TextBoxWidth    =   2395
         End
         Begin ITGControls.ITGTextBox txtType 
            Height          =   285
            Left            =   8400
            TabIndex        =   27
            Top             =   555
            Width           =   945
            _ExtentX        =   1561
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Street"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   885
         End
         Begin ITGControls.ITGTextBox txtTruck 
            Height          =   285
            Left            =   6795
            TabIndex        =   5
            Top             =   1200
            Width           =   2145
            _ExtentX        =   3572
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            Label           =   "Truck"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   900
            TextBoxWidth    =   1185
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Country / Zip"
            Height          =   195
            Left            =   210
            TabIndex        =   23
            Top             =   3165
            Width           =   945
         End
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   28
      Top             =   7875
      Width           =   10710
      _ExtentX        =   18891
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin VB.Image imgLogo 
      BorderStyle     =   1  'Fixed Single
      Height          =   930
      Left            =   9345
      Stretch         =   -1  'True
      Top             =   0
      Width           =   1125
   End
   Begin VB.Shape Shape1 
      BorderColor     =   &H00404040&
      Height          =   975
      Left            =   0
      Top             =   0
      Width           =   9270
   End
   Begin VB.Label lblHeader 
      BackColor       =   &H00F7D9C2&
      BackStyle       =   0  'Transparent
      Caption         =   "Forwarder ID - Forwarder Name"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   375
      Left            =   165
      TabIndex        =   25
      Top             =   150
      Width           =   8835
   End
   Begin VB.Label lblDetails 
      BackColor       =   &H00F7D9C2&
      BackStyle       =   0  'Transparent
      Caption         =   "Address"
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   165
      TabIndex        =   24
      Top             =   510
      Visible         =   0   'False
      Width           =   9150
   End
End
Attribute VB_Name = "frmMaintTrucker"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IT Group Inc. 2005.09.23

Option Explicit

'Object variables





'Recordset variables
Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1
Private rsDetail As ADODB.Recordset

'ADO Connection variables

Private connHeader As ADODB.Connection
Private connDetail As ADODB.Connection

'Form mode enumeration
Public Enum eTruckerMode
    Normal
    AddNewEdit
    Find
End Enum
Private Mode As eTruckerMode

'Other declaration
Public dtgName As String
Public sBit As String
Private vBM As Variant 'Recordset bookmark variable

'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cboCountry_Click()
    txtCountry = Trim(cboCountry)
End Sub

Private Sub cboType_Change()
    txtType = Trim(cboType)
End Sub

Private Sub cboType_Click()
    txtType = Trim(cboType)
End Sub


Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
    SortGrid dtgList, ColIndex, rsHeader
End Sub

Private Sub dtgRouteRate_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 0
            If GetValueFrTable("cRouteCode", "TRUCKER_ROUTE", "cRouteCode = '" & Trim(dtgRouteRate.Columns(0).Value) & "'") <> "" Then
                GetRouteInfo rsDetail, Trim(dtgRouteRate.Columns(0).Value)
            End If
        Case 4
            rsDetail!dLastUpdated = Date
    End Select
End Sub

Private Sub dtgRouteRate_ButtonClick(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 0
            If lPickListActive Then Exit Sub
            sFilterString = Trim(dtgRouteRate.Columns(0).Text)
            frmITGPicker.zType = QTruckerRoute
            frmITGPicker.Show vbModal
            dtgRouteRate.Columns(0).Value = Trim(frmITGPicker.zCode) & ""
            If (Trim(frmITGPicker.zCode) & "") <> "" Then
                GetRouteInfo rsDetail, dtgRouteRate.Columns(0).Value
            End If
            dtgRouteRate.Col = 4
            dtgRouteRate.Columns(4).Value = rsDetail!nRates
    End Select
End Sub

'Set the datagrid as active control
Private Sub dtgRouteRate_Click()
    If Mode = AddNewEdit Then dtgName = dtgRouteRate.Name
End Sub

Private Sub dtgRouteRate_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgRouteRate_GotFocus()
    dtgName = dtgRouteRate.Name
End Sub

Private Sub dtgRouteRate_HeadClick(ByVal ColIndex As Integer)
    If Mode = AddNewEdit Then Exit Sub
    SortGrid dtgRouteRate, ColIndex, rsDetail
End Sub

Private Sub dtgRouteRate_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgRouteRate_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If rsDetail.RecordCount = 0 Then Exit Sub

    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}

    If KeyAscii = 13 Then
        Select Case dtgRouteRate.Col
            Case 0
                If GetValueFrTable("cRouteCode", "TRUCKER_ROUTE", "cRouteCode = '" & Trim(dtgRouteRate.Columns(0).Text) & "'") = "" Then
                    dtgRouteRate_ButtonClick (0) 'use button click
                End If
            Case 4
                TBNewLine
                dtgRouteRate.LeftCol = 0
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

'Right click menu popup
Private Sub dtgRouteRate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgRouteRate.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

'Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
'    SortGrid dtgList, ColIndex, rsHeader
'End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

'Set Your Object
Private Sub Form_Load()
        
    Set FrmName = Me
    FormSetup
    
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'MF28'")
    
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
    
    
    'CallComboBox Values
    Call LoadComboValues(cboCountry, "cValue", "PARAMETER_SYSTEM", "WHERE cType = 'COUNTRY'")
    
    FormLocking True
    FormSearch True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    
    imgLogo.Picture = ITGLedgerMain.Picture1.Picture
    Mode = Find
    txtTruckerCode.Locked = False
    
End Sub

'Activate your Toolbar Mode
Private Sub Form_Activate()
    TBBitReload
End Sub

'Release your Object
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
    
    
    
    
    
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set connHeader = Nothing
    Set connDetail = Nothing
    
    Set frmMaintTrucker = Nothing

    lCloseWindow = True
    
'    'oForm(Me.Tag).Mode = 1
'    'oForm(Me.Tag).Tag = Me.Tag
End Sub

'Add new record to the recordset
Public Sub TBNew()
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtTruckerCode.BackColor = &HE0FFFF
    rsDetail.Sort = ""
    Mode = AddNewEdit
    
    If rsHeader.State <> adStateOpen Then
        OpenNewConnection connHeader
        OpenNewConnection connDetail
        OpenRecordsetWithCN rsDetail, "*", "TRUCKER_RATE", connDetail, "WHERE 1 = 0"
        OpenRecordsetWithCN rsHeader, "*", "TRUCKER", connHeader, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else
        vBM = rsHeader.Bookmark
    End If
    
    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    cboCountry = "Philippines"
    rsHeader!lInsured = False
    
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    SSTab1.ActiveTab = 0
    txtTruckerCode.SetFocus

End Sub

'Undo all changes to the recordset
Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent
    
    rsHeader.CancelBatch adAffectAll
    rsDetail.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
    
    Set FrmName = Me
    FormLocking True
    
    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Else
        RSZero
        Mode = Find
    End If
    
    sbRS.Panels(2) = ""

    SetDataSource
    SetDataField

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoAll
    End If

End Sub

'Undo changes on the current record
Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler

    GetChild
    If rsHeader.Status = adRecNew Then
        rsDetail.CancelBatch adAffectAll
        rsHeader.CancelUpdate
    Else
        rsHeader.CancelBatch adAffectCurrent
        rsDetail.CancelBatch adAffectAll
    End If
   
    If rsHeader.RecordCount = 0 Then RSZero

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoCurrent
    End If

End Sub

'Save all changes
Public Sub TBSave()
Dim OKUpdate As Boolean
On Error GoTo ErrHandler

    'Audit Trail
    lBoolean = False
    If rsHeader.Status = adRecNew Then lBoolean = True

    If Not MandatoryOK Then Exit Sub
    
    OKUpdate = False
    cn.BeginTrans
    connHeader.BeginTrans
    connDetail.BeginTrans
    
    rsHeader.UpdateBatch adAffectAll
    rsDetail.UpdateBatch adAffectAll
    
    cn.CommitTrans
    connHeader.CommitTrans
    connDetail.CommitTrans
    OKUpdate = True
    
    Set FrmName = Me
    FormLocking True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
    Mode = Normal

    MsgBox "Record/s successfully saved.", vbInformation, "iTG Finance Manager"
    SetDataSource
    'Audit trail
    UpdateLogFile "Trucker", Trim(txtTruckerCode), IIf(lBoolean, "Inserted", "Updated")
    
    lblHeader = rsHeader!cTruckerCode & " - " & rsHeader!cName & ""
    lblDetails = rsHeader!cAddress & ""
    sbRS.Panels(2) = ""

ErrHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        connHeader.RollbackTrans
        connDetail.RollbackTrans
        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, "iTG Finance Manager"
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        rsDetail.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, "iTG Finance Manager"
        cn.RollbackTrans
        connHeader.RollbackTrans
        connDetail.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name 'Error log
    End If
    
End Sub

'Sets the form & recorset to add/edit mode
Public Sub TBEdit()
    rsDetail.Sort = ""
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtTruckerCode.Locked = True
    SSTab1.ActiveTab = 0
    txtName.SetFocus
    vBM = rsHeader.Bookmark
End Sub

'Delete record
Public Sub TBDelete()
On Error GoTo ErrorHandler
    
    sID = Trim(txtTruckerCode)
    
    If rsHeader.RecordCount = 0 Then Exit Sub
    
    If GetValueFrTable("cTruckerCode", "V_TruckerRef", "cTruckerCode = '" & Trim(txtTruckerCode) & "'") <> "" Then
        MsgBox "Trucker was referenced. Deletion is not allowed.", vbExclamation, "iTG Finance Manager"
        Exit Sub
    End If
    
    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "iTG Finance Manager") = vbNo Then Exit Sub
    
    GetChild
    If rsDetail.RecordCount <> 0 Then
        rsDetail.MoveFirst
        Do Until rsDetail.RecordCount = 0
            rsDetail.Delete adAffectCurrent
            If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
        Loop
    End If
    
    'Audit trail
    UpdateLogFile "Trucker", Trim(txtTruckerCode), "Deleted"

    rsHeader.Delete adAffectCurrent
    rsDetail.UpdateBatch adAffectAll
    rsHeader.UpdateBatch adAffectAll
    
    TBPrevRec

    Mode = Normal
    
    If rsHeader.RecordCount = 0 Then
        RSZero
    Else
        vBookMark = rsHeader.Bookmark
        UnbindControls
        SetDataSource
        SetDataField
        rsHeader.Bookmark = vBookMark
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        cn.Execute "DELETE TRUCKER_RATE WHERE cTruckerCode = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE TRUCKER WHERE cTruckerCode = '" & sID & "' AND cCompanyID = '" & COID & "'"
        Resume Next
    End If

End Sub

'Search using the frmITGSearch
Public Sub TBFind()
    'NA
End Sub

'Search using the recordset primary key
Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
            
    OpenNewConnection connHeader
    OpenNewConnection connDetail
    
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
            
    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtTruckerCode.Locked = False
        txtTruckerCode.SetFocus
        Exit Sub
    End If
           
    OpenRecordsetWithCN rsHeader, "*", "TRUCKER", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
    'OpenRecordsetWithCN rsDetail, "*", "TRUCKER_RATE", connDetail
    
    OpenRecordsetWithCN rsDetail, "*", "TRUCKER_RATE", connDetail, IIf(sTemp = "", "", " WHERE cTruckerCode IN (SELECT cTruckerCode FROM Trucker WHERE " & sTemp & ")")
     
    Set FrmName = Me
    FormLocking True
                    
    If rsHeader.RecordCount = 0 Then
        FormWaitHide
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        FormSearch True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtTruckerCode.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True

    FormWaitHide
Else
    RSZero
    FormSearch True
    Mode = Find
   
End If

End Sub
'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
    dtgName = dtgRouteRate.Name
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Move first
Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader

End Sub

'Move previous
Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader

End Sub

'Move next
Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader

End Sub

'Move last
Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader

End Sub

'Add new line to the detail recordset
Public Sub TBNewLine()
    
    If rsHeader!cTruckerCode = "" Then Exit Sub
    
    If dtgName = "dtgRouteRate" Then
        rsDetail.AddNew
        rsDetail!cCompanyID = COID
        rsDetail!cTruckerCode = Trim(txtTruckerCode)
        GetChild
        If rsDetail.RecordCount <> 0 Then rsDetail.MoveLast
        dtgRouteRate.Col = 0
        dtgRouteRate.Columns(0).Value = ""
        dtgRouteRate.SetFocus
    End If

    

End Sub

'Delete line in the detail recordset
Public Sub TBDeleteLine()
On Error GoTo ErrorHandler

    If dtgName = "dtgRouteRate" Then
        If rsDetail.RecordCount = 0 Then Exit Sub
        vBookMark = dtgRouteRate.Bookmark
        GetChild
        dtgRouteRate.Bookmark = vBookMark
        rsDetail.Delete adAffectCurrent
    End If
    GetChild

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo all
Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Undo current line
Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Post current record
Public Sub TBPostRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Cancel current record
Public Sub TBCancelRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Print
Public Sub TBPrintRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Sets the data source of the controls
Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgRouteRate.DataSource = rsDetail
    Set dtgList.DataSource = rsHeader
   
End Sub
    
'Sets the data field for every bounded controls
Sub SetDataField()
    With rsHeader
        txtTruckerCode.DataField = !cTruckerCode
        txtName.DataField = !cName
        txtPayee.DataField = !cPayee
        txtAddress.DataField = !cAddress
        txtCity.DataField = !cCity
        txtState.DataField = !cState
        txtCountry.DataField = !cCountry
        txtZip.DataField = !cZip
        txtPhone.DataField = !cTel
        txtFax.DataField = !cFax
        txtInternet.DataField = !cInternet
        txtEmail.DataField = !cEMail
        txtTIN.DataField = !cTIN
        txtOwner.DataField = !cOwner
        txtContact.DataField = !cContact
        chkInsured.DataField = !lInsured
        txtTruck.DataField = !nTruck
        txtTrailer.DataField = !nTrailer
        txtVan.DataField = !nVan
        txtType.DataField = !cType
    End With
End Sub

Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler
    
    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        lblHeader = rsHeader!cTruckerCode & " - " & rsHeader!cName & ""
        lblDetails = rsHeader!cAddress & ""
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount

        If rsHeader.Status <> adRecNew Then
            txtTruckerCode.Locked = True
        Else
            txtTruckerCode.Locked = False
        End If

        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else
            sbRS.Panels(2) = ""
        End If

        GetChild
    
    Else
        lblHeader = "Trucker ID - Name"
        lblDetails = "Address"
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtTruckerCode.Locked = False
    End If

    If Mode = AddNewEdit Then
        dtgRouteRate.Refresh
    End If

ErrorHandler:
    'Err.Number -2147217885
    'Description - Row handle referred to a deleted row or a row marked for deletion.
    If err.Number = -2147217885 Then
        Resume Next
    End If
    
End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab1.TabEnabled(1) = False
    Else
        SSTab1.TabEnabled(1) = True
    End If
End Sub

Private Sub txtCountry_Change()
    If Trim(txtCountry) <> "" Or txtCountry <> vbNullString Then
        cboCountry = Trim(txtCountry)
    Else
        cboCountry.ListIndex = -1
    End If
End Sub

Private Sub txtTruckerCode_LostFocus()
    'Does Code Already exists
    If Mode = AddNewEdit Then
        If Trim(txtTruckerCode) = "" Then
            MsgBox "Empty primary input.", vbInformation, "iTG Finance Manager"
            If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
            txtTruckerCode.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtTruckerCode = Trim(txtTruckerCode)
            If IDExisting(rsHeader, "cTruckerCode", "TRUCKER", Trim(rsHeader!cTruckerCode)) Then
                MsgBox "Trucker ID already exists.", vbInformation, "iTG Finance Manager"
                If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
                txtTruckerCode.SetFocus
            End If
        End If
    End If
End Sub

'Check if all mandatory fields are complete
Function MandatoryOK() As Boolean
    
    MandatoryOK = True
    
    If Trim(txtTruckerCode) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Trucker ID' is mandatory. Null value is not allowed.", vbInformation, "iTG Finance Manager"
        txtTruckerCode.SetFocus
        Exit Function
    End If
    
    If rsHeader.Status = adRecNew Then
        If IDExisting(rsHeader, "cTruckerCode", "TRUCKER", Trim(rsHeader!cTruckerCode)) Then
            MandatoryOK = False
            MsgBox "Trucker ID already exists.", vbInformation, "iTG Finance Manager"
            txtTruckerCode.SetFocus
            Exit Function
        End If
    End If
    
    If Trim(txtName) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Trucker Name' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        txtName.SetFocus
        Exit Function
    ElseIf Trim(txtContact) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Contact' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        txtContact.SetFocus
        Exit Function
    ElseIf Trim(txtAddress) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Address' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        txtAddress.SetFocus
        Exit Function
    ElseIf Trim(txtCountry) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Country' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        cboCountry.SetFocus
        Exit Function
    ElseIf Trim(txtPhone) = "" Then
        MsgBox "Field 'Phone' is mandatory. Null value is not allowed", vbInformation, "iTG Finance Manager"
        MandatoryOK = False
        txtPhone.SetFocus
        Exit Function
    End If
    
    GetChild
    
    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
    Do Until rsDetail.EOF
        If rsDetail.Status = (adRecNew) Or rsDetail.Status = (adRecModified) Then
            If IsNull(rsDetail!cRouteCode) Then
                rsDetail.Delete
            ElseIf Trim(rsDetail!cRouteCode) = "" Then
                rsDetail.Delete
            Else
                rsDetail.MoveNext
            End If
        Else
            rsDetail.MoveNext
        End If
    Loop
    
    GetChild
    
End Function

'Filter detail recordset to header's primary
Private Sub GetChild()
    rsDetail.Filter = "cTruckerCode = '" & Trim(rsHeader!cTruckerCode) & "'"
End Sub

'Sets the form if record number is zero
Private Sub RSZero()
    lblHeader = "Trucker ID - Name"
    lblDetails = "Address"
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    
    Set dtgRouteRate.DataSource = Nothing
    dtgRouteRate.Refresh
    
    Set FrmName = Me
    UnbindControls
    TextClearing
    FormLocking True
    
    If rsHeader.State = adStateOpen Then rsHeader.Close
    If rsDetail.State = adStateOpen Then rsDetail.Close
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    
    txtTruckerCode.Locked = False
    txtTruckerCode.SetFocus
    
    Mode = Find
End Sub

'Gets route info
Private Sub GetRouteInfo(RefRS As Recordset, RouteCode As String)
    RefRS!cOrigin = Trim(GetValueFrTable("cOrigin", "TRUCKER_ROUTE", "cRouteCode = '" & Trim(RouteCode) & "'")) & ""
    RefRS!cDestination = Trim(GetValueFrTable("cDestination", "TRUCKER_ROUTE", "cRouteCode = '" & Trim(RouteCode) & "'")) & ""
    RefRS!nKM = GetValueFrTable("nKM", "TRUCKER_ROUTE", "cRouteCode = '" & Trim(RouteCode) & "'") & ""
    RefRS!nRates = 0
    RefRS!dDate = Date
    RefRS!dLastUpdated = Date
    CheckDoubleDetails rsDetail!cRouteCode
End Sub

Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtTruckerCode.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cTruckerCode LIKE '" & Trim$(txtTruckerCode.Text) & "%'"
    End If

    If Trim$(txtName.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cName LIKE '" & Trim$(txtName.Text) & "%'"
    End If
    
    If Trim$(txtPayee.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cPayee LIKE '" & Trim$(txtPayee.Text) & "%'"
    End If
    
    If Trim$(txtContact.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cContact LIKE '" & Trim$(txtContact.Text) & "%'"
    End If
    
    If Trim$(txtOwner.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cOwner LIKE '" & Trim$(txtOwner.Text) & "%'"
    End If
    
    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

'Check for existing route detail
Sub CheckDoubleDetails(RefNo As String)
    
    rsDetail.MovePrevious
    Do While Not rsDetail.BOF
        If rsDetail.EOF Then
            Beep
        Else
            If RefNo = rsDetail!cRouteCode And rsDetail.RecordCount > 1 Then
                If Not rsDetail.EOF Then
                    MsgBox "Route already exist.", vbCritical + vbOKOnly, "iTG Finance Manager"
                    rsDetail.MoveLast
                    TBDeleteLine
                    rsDetail.MoveLast
                    Exit Sub
                End If
            End If
        End If
        rsDetail.MovePrevious
    Loop
    
    If rsDetail.RecordCount > 0 Then
        rsDetail.MoveLast
        'dtgRouteRate.Col = 5
    End If
End Sub

'Public Sub ShowForm(sTranNo As String)
'    If Mode = Find Then
'
'        OpenNewConnection connHeader
'        OpenNewConnection connDetail
'
'        Set rsHeader = Nothing
'        Set rsDetail = Nothing
'        Set rsHeader = New ADODB.Recordset
'        Set rsDetail = New ADODB.Recordset
'
'        OpenRecordsetWithCN rsDetail, "*", "TRUCKER_RATE", connDetail, "WHERE cTruckerCode = '" & Trim(sTranNo) & "'"
'        OpenRecordsetWithCN rsHeader, "*", "TRUCKER", connHeader, "WHERE cTruckerCode = '" & Trim(sTranNo) & "'"
'
'        Set FrmName = Me
'        FormLocking True
'
'        If rsHeader.RecordCount = 0 Then
'            FormWaitHide
'            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
'            RSZero
'            FormSearch True
'            Mode = Find
'            Exit Sub
'        End If
'            SetDataSource
'            SetDataField
'            txtTruckerCode.BackColor = &HE0FFFF
'            Mode = Normal
'            oBar.BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True
'
'    End If
'End Sub


Private Sub txtType_Change()
    If Trim(txtType) <> "" Or txtType <> vbNullString Then
        cboType = Trim(txtType)
    Else: cboType.ListIndex = -1
    End If
End Sub



